<?php
namespace Admin\Model;
use Think\Model\RelationModel;


class UserModel extends RelationModel {
	//关联表
	protected $_link = array(
	    'roleInfo' => array(
	        'mapping_type'   => self::HAS_ONE,
	        'foreign_key'    => 'id',
	        'class_name'     => 'role',
	        'mapping_key'    => 'role',
	        'as_fields'      => 'name:roleName'
	    ),
	);

}